package timu3;

public class DatabaseConnectionManager {
    private static volatile DatabaseConnectionManager instance;
    private Connection connection;
    private  DatabaseConnectionManager(Connection connection){
        this.connection=connection;
    }

    public static synchronized  DatabaseConnectionManager getInstance(Connection connection){
        if (instance==null){
            instance=new DatabaseConnectionManager(connection);
        }
        return instance;
    }
    public void connect(){
        connection.connect();
    }
}
